<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arduino A2DP: src/BluetoothA2DPCommon.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Arduino A2DP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">BluetoothA2DPCommon.h</div></div>
</div><!--header-->
<div class="contents">
<a href="_bluetooth_a2_d_p_common_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment">//     http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment">//</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment">// limitations under the License.</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="comment">//</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment">// Copyright 2020 Phil Schatzmann</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#include &quot;config.h&quot;</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="preprocessor">#include &lt;unistd.h&gt;</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#include &lt;stdbool.h&gt;</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">#include &lt;math.h&gt;</span>    </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span> <span class="comment">// needed for ESP Arduino &lt; 2.0    </span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">#include &quot;freertos/timers.h&quot;</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">#include &quot;freertos/xtensa_api.h&quot;</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">#include &quot;freertos/FreeRTOSConfig.h&quot;</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#include &quot;freertos/queue.h&quot;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">#include &quot;freertos/task.h&quot;</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#include &quot;esp_bt.h&quot;</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#include &quot;esp_bt_main.h&quot;</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="preprocessor">#include &quot;esp_bt_device.h&quot;</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#include &quot;esp_gap_bt_api.h&quot;</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="preprocessor">#include &quot;esp_a2dp_api.h&quot;</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#include &quot;driver/i2s.h&quot;</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="preprocessor">#include &quot;esp_avrc_api.h&quot;</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="preprocessor">#include &quot;esp_spp_api.h&quot;</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="preprocessor">#include &quot;nvs.h&quot;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span><span class="preprocessor">#include &quot;nvs_flash.h&quot;</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span><span class="preprocessor">#include &quot;SoundData.h&quot;</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="preprocessor">#include &quot;A2DPVolumeControl.h&quot;</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="preprocessor">#include &quot;esp_task_wdt.h&quot;</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><span class="preprocessor">#ifdef ARDUINO_ARCH_ESP32</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span><span class="preprocessor">#include &quot;esp32-hal-log.h&quot;</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span><span class="preprocessor">#include &quot;esp32-hal-bt.h&quot;</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span><span class="preprocessor">#include &quot;esp_log.h&quot;</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="_bluetooth_a2_d_p_common_8h.html#a920f1d5645eff5bb9dedd84d5c20f794">btStart</a>();</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_bluetooth_a2_d_p_common_8h.html#a1ea0f006ec5db0c83e80adb8dca80e34">delay</a>(<span class="keywordtype">long</span> millis);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> millis();</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span><span class="comment">// Support for old and new IDF version</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span><span class="preprocessor">#if !defined(ESP_IDF_4) &amp;&amp; !defined(I2S_COMM_FORMAT_STAND_I2S)</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span><span class="comment">// support for old idf releases</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span><span class="preprocessor"># define I2S_COMM_FORMAT_STAND_I2S (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB)</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span><span class="preprocessor"># define I2S_COMM_FORMAT_STAND_MSB (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_LSB)</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span><span class="preprocessor"># define I2S_COMM_FORMAT_STAND_PCM_LONG (I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_LONG)</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span><span class="preprocessor"># define I2S_COMM_FORMAT_STAND_PCM_SHORT (I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_SHORT)</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="_bluetooth_a2_d_p_common_8h.html#a9bee258e477be3c0e70d6029ed86a019">   80</a></span><span class="keyword">typedef</span> void (* <a class="code hl_typedef" href="_bluetooth_a2_d_p_common_8h.html#a9bee258e477be3c0e70d6029ed86a019">app_callback_t</a>) (uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="structapp__msg__t.html">   83</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="structapp__msg__t.html#aa9e22bf7fadbb972d0ea4e8841565d36">   84</a></span>    uint16_t             <a class="code hl_variable" href="structapp__msg__t.html#aa9e22bf7fadbb972d0ea4e8841565d36">sig</a>;      </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="structapp__msg__t.html#a94101fa8211369ac8234e5052922bf1d">   85</a></span>    uint16_t             <a class="code hl_variable" href="structapp__msg__t.html#a94101fa8211369ac8234e5052922bf1d">event</a>;    </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="structapp__msg__t.html#a178b4f47f5dec620dd55568a112bed5c">   86</a></span>    <a class="code hl_typedef" href="_bluetooth_a2_d_p_common_8h.html#a9bee258e477be3c0e70d6029ed86a019">app_callback_t</a>       <a class="code hl_variable" href="structapp__msg__t.html#a178b4f47f5dec620dd55568a112bed5c">cb</a>;       </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="structapp__msg__t.html#ad3a963624af293f30fb8125e7b5835b6">   87</a></span>    <span class="keywordtype">void</span>                 *<a class="code hl_variable" href="structapp__msg__t.html#ad3a963624af293f30fb8125e7b5835b6">param</a>;   </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>} <a class="code hl_struct" href="structapp__msg__t.html">app_msg_t</a>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span><span class="preprocessor">#define BT_AV_TAG        &quot;BT_AV&quot;</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span><span class="preprocessor">#define BT_RC_CT_TAG     &quot;RCCT&quot;</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="preprocessor">#define BT_APP_TAG       &quot;BT_API&quot;</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span><span class="comment">/* AVRCP used transaction labels */</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span><span class="preprocessor">#define APP_RC_CT_TL_GET_CAPS            (0)</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span><span class="preprocessor">#define APP_RC_CT_TL_GET_META_DATA       (1)</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="preprocessor">#define APP_RC_CT_TL_RN_TRACK_CHANGE     (2)</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="preprocessor">#define APP_RC_CT_TL_RN_PLAYBACK_CHANGE  (3)</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span><span class="preprocessor">#define APP_RC_CT_TL_RN_PLAY_POS_CHANGE  (4)</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span><span class="keyword">enum</span> ReconnectStatus { NoReconnect, AutoReconnect, IsReconnecting};</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html">  111</a></span><span class="keyword">class </span><a class="code hl_class" href="class_bluetooth_a2_d_p_common.html">BluetoothA2DPCommon</a> {</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a4bbbd1a2c9c85004afaa7c6dbad45322">  114</a></span>        <span class="keyword">virtual</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a4bbbd1a2c9c85004afaa7c6dbad45322">~BluetoothA2DPCommon</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>    </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a537d576b12d1158eb0681a6195b258de">set_auto_reconnect</a>(<span class="keywordtype">bool</span> active);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#ab63e627832d6377be32dd700130bf0d8">disconnect</a>();</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#ac795a023f85438355a1b00644f2b040f">reconnect</a>();</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a788d81fe538021f912d737de72ed6be6">connect_to</a>(esp_bd_addr_t peer);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a0a8a860a325348cdf210637e8d1159e6">set_connected</a>(<span class="keywordtype">bool</span> active);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a76e329bf0587ebf41792871acc69188b">end</a>(<span class="keywordtype">bool</span> releaseMemory=<span class="keyword">false</span>);</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a168bc344644da48b595e284b7800e3f2">  135</a></span>        <span class="keyword">virtual</span>  <span class="keywordtype">bool</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a168bc344644da48b595e284b7800e3f2">is_connected</a>() = 0;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a0bab92d9317837ecaeacbfe26814e28c">  138</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a0bab92d9317837ecaeacbfe26814e28c">set_volume</a>(uint8_t volume){</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>            ESP_LOGI(BT_AV_TAG, <span class="stringliteral">&quot;set_volume: %d&quot;</span>, volume);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>            volume_value = volume;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>            <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a8f1619be2457a0a9e359ff4fefe1dbf6">volume_control</a>()-&gt;set_volume(volume);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>            <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a8f1619be2457a0a9e359ff4fefe1dbf6">volume_control</a>()-&gt;set_enabled(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>            is_volume_used = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>        }</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>            </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a0e570c2c2f9db40873286e0571f0d93a">  147</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a0e570c2c2f9db40873286e0571f0d93a">get_volume</a>(){</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>            <span class="keywordflow">return</span> is_volume_used ? volume_value : 0;</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>        }</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span> </div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a7757ddbf424aeb909dc952d7c40fc241">  152</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a7757ddbf424aeb909dc952d7c40fc241">set_volume_control</a>(<a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> *ptr){</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>            volume_control_ptr = ptr;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>        }</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span> </div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>        <span class="keyword">virtual</span> esp_a2d_audio_state_t <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a74eadbd69b5c7adf1b190c7e41b75b10">get_audio_state</a>();</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>    </div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>        <span class="keyword">virtual</span> esp_a2d_connection_state_t <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a513b32676d8fc248bb481180f832ef97">get_connection_state</a>();</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span> </div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#aa79cff78c075c9273ea2b5c03f052fcd">set_on_connection_state_changed</a>(<span class="keywordtype">void</span> (*callBack)(esp_a2d_connection_state_t state, <span class="keywordtype">void</span> *), <span class="keywordtype">void</span> *obj=<span class="keyword">nullptr</span>);</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a169e9b94cbbfb7311a8722cc6d436e95">set_on_audio_state_changed_post</a>(<span class="keywordtype">void</span> (*callBack)(esp_a2d_audio_state_t state, <span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* obj=<span class="keyword">nullptr</span>);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a5f13ecf541393c21a5a489235bad27fb">set_on_audio_state_changed</a>(<span class="keywordtype">void</span> (*callBack)(esp_a2d_audio_state_t state, <span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* obj=<span class="keyword">nullptr</span>);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#aa6601d3c57e37f77bfdd03a3ef6231e2">debounce</a>(<span class="keywordtype">void</span>(*cb)(<span class="keywordtype">void</span>),<span class="keywordtype">int</span> ms);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a791432e5c800e75fb11b858071cff651">log_free_heap</a>();</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span> </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>        <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a2b78346084e12feeea035d006e7cf07a">to_str</a>(esp_a2d_connection_state_t state);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span> </div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>        <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a2b78346084e12feeea035d006e7cf07a">to_str</a>(esp_a2d_audio_state_t state);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>        <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a2b78346084e12feeea035d006e7cf07a">to_str</a>(esp_bd_addr_t bda);</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>        <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a2b78346084e12feeea035d006e7cf07a">to_str</a>(esp_avrc_playback_stat_t state);</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a68f9e168839f0faeb72705ccabbb6b7a">  192</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a68f9e168839f0faeb72705ccabbb6b7a">set_task_priority</a>(UBaseType_t priority){</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>            task_priority = priority;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>        }</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a694940fad2a2d498875cfbdf52eea58b">  198</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a694940fad2a2d498875cfbdf52eea58b">set_task_core</a>(BaseType_t core){</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span>            task_core = core;</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span>        }</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#ae5e96c34428c50873a0ca7423a6b5402">  203</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#ae5e96c34428c50873a0ca7423a6b5402">set_event_queue_size</a>(<span class="keywordtype">int</span> size){</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>            event_queue_size = size;</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>        }</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span> </div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a04bc52a4279a503203084492fe20c32e">  208</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a04bc52a4279a503203084492fe20c32e">set_event_stack_size</a>(<span class="keywordtype">int</span> size){</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span>            event_stack_size = size;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>        }</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span> </div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#acf924bb9f5e348c85e65879c337a4bde">  213</a></span>        <span class="keyword">virtual</span> esp_bd_addr_t* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#acf924bb9f5e348c85e65879c337a4bde">get_last_peer_address</a>() {</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>            <span class="keywordflow">return</span> &amp;last_connection;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span>        }</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span> </div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span><span class="preprocessor">#ifdef ESP_IDF_4</span></div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a8e53adc58f665113c9ac6a5521e58814">set_discoverability</a>(esp_bt_discovery_mode_t d);</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span> </div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a8b37f48a6b0bca33fb21b2a9ae9dab7c">  223</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a8b37f48a6b0bca33fb21b2a9ae9dab7c">set_connectable</a>(<span class="keywordtype">bool</span> connectable) {</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>        <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#af1e2f14ddbe9266b61f5e721095c3685">set_scan_mode_connectable</a>(connectable);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>    }</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a458bca4d65937c5e2de7bfeb0f454d88">  228</a></span>    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a458bca4d65937c5e2de7bfeb0f454d88">get_name</a>() {</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>        <span class="keywordflow">return</span> bt_name;</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>    }</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span> </div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a962cc9aef396b06c7eb6f56462a743ac">clean_last_connection</a>();</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span>    <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>        <span class="keyword">const</span> <span class="keywordtype">char</span>* bt_name = {0};</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>        esp_bd_addr_t peer_bd_addr;</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>        ReconnectStatus reconnect_status = AutoReconnect;</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>        <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> reconnect_timout=0;</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> default_reconnect_timout=10000;</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>        <span class="keywordtype">bool</span> is_autoreconnect_allowed = <span class="keyword">false</span>; </div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>        uint32_t debounce_ms = 0;</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span>        <a class="code hl_class" href="class_a2_d_p_default_volume_control.html">A2DPDefaultVolumeControl</a> default_volume_control;</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span>        <a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> *volume_control_ptr = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span>        esp_bd_addr_t last_connection = {0,0,0,0,0,0};</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>        <span class="keywordtype">bool</span> is_start_disabled = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span>        void (*connection_state_callback)(esp_a2d_connection_state_t state, <span class="keywordtype">void</span>* obj) = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span>        void (*audio_state_callback)(esp_a2d_audio_state_t state, <span class="keywordtype">void</span>* obj) = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span>        void (*audio_state_callback_post)(esp_a2d_audio_state_t state, <span class="keywordtype">void</span>* obj) = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span>        <span class="keywordtype">void</span> *connection_state_obj = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>        <span class="keywordtype">void</span> *audio_state_obj = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>        <span class="keywordtype">void</span> *audio_state_obj_post = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>        <span class="keyword">const</span> <span class="keywordtype">char</span> *m_a2d_conn_state_str[4] = {<span class="stringliteral">&quot;Disconnected&quot;</span>, <span class="stringliteral">&quot;Connecting&quot;</span>, <span class="stringliteral">&quot;Connected&quot;</span>, <span class="stringliteral">&quot;Disconnecting&quot;</span>};</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>        <span class="keyword">const</span> <span class="keywordtype">char</span> *m_a2d_audio_state_str[3] = {<span class="stringliteral">&quot;Suspended&quot;</span>, <span class="stringliteral">&quot;Stopped&quot;</span>, <span class="stringliteral">&quot;Started&quot;</span>};</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>        <span class="keyword">const</span> <span class="keywordtype">char</span> *m_avrc_playback_state_str[5] = {<span class="stringliteral">&quot;stopped&quot;</span>, <span class="stringliteral">&quot;playing&quot;</span>, <span class="stringliteral">&quot;paused&quot;</span>, <span class="stringliteral">&quot;forward seek&quot;</span>, <span class="stringliteral">&quot;reverse seek&quot;</span>};</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>        esp_a2d_audio_state_t audio_state = ESP_A2D_AUDIO_STATE_STOPPED;</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span>        esp_a2d_connection_state_t connection_state = ESP_A2D_CONNECTION_STATE_DISCONNECTED;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>        UBaseType_t task_priority = configMAX_PRIORITIES - 10;</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>        <span class="comment">// volume </span></div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span>        uint8_t volume_value = 0;</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>        <span class="keywordtype">bool</span> is_volume_used = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>        BaseType_t task_core = 1;</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span> </div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span>        <span class="keywordtype">int</span> event_queue_size = 20;</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span>        <span class="keywordtype">int</span> event_stack_size = 3072;</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span> </div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span> </div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span><span class="preprocessor">#ifdef ESP_IDF_4</span></div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span>        esp_bt_discovery_mode_t discoverability = ESP_BT_GENERAL_DISCOVERABLE;</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span> </div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>        <span class="keyword">virtual</span> esp_err_t esp_a2d_connect(esp_bd_addr_t peer) = 0;</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>        <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* last_bda_nvs_name() = 0;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> get_last_connection();</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_last_connection(esp_bd_addr_t bda);</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> has_last_connection();</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>        <span class="comment">// change the scan mode</span></div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#af1e2f14ddbe9266b61f5e721095c3685">set_scan_mode_connectable</a>(<span class="keywordtype">bool</span> connectable);</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno">  279</span> </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_common.html#a8f1619be2457a0a9e359ff4fefe1dbf6">  281</a></span>        <span class="keyword">virtual</span> <a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a>* <a class="code hl_function" href="class_bluetooth_a2_d_p_common.html#a8f1619be2457a0a9e359ff4fefe1dbf6">volume_control</a>() {</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span>            <span class="keywordflow">return</span> volume_control_ptr !=<span class="keyword">nullptr</span> ? volume_control_ptr : &amp;default_volume_control;</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span>        }</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>};</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span> </div>
<div class="ttc" id="a_bluetooth_a2_d_p_common_8h_html_a1ea0f006ec5db0c83e80adb8dca80e34"><div class="ttname"><a href="_bluetooth_a2_d_p_common_8h.html#a1ea0f006ec5db0c83e80adb8dca80e34">delay</a></div><div class="ttdeci">void delay(long millis)</div><div class="ttdoc">call vTaskDelay to deley for the indicated number of milliseconds</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:354</div></div>
<div class="ttc" id="a_bluetooth_a2_d_p_common_8h_html_a920f1d5645eff5bb9dedd84d5c20f794"><div class="ttname"><a href="_bluetooth_a2_d_p_common_8h.html#a920f1d5645eff5bb9dedd84d5c20f794">btStart</a></div><div class="ttdeci">bool btStart()</div><div class="ttdoc">Startup logic as implemented by Arduino - This is not available if we use this library outside of Ard...</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:328</div></div>
<div class="ttc" id="a_bluetooth_a2_d_p_common_8h_html_a9bee258e477be3c0e70d6029ed86a019"><div class="ttname"><a href="_bluetooth_a2_d_p_common_8h.html#a9bee258e477be3c0e70d6029ed86a019">app_callback_t</a></div><div class="ttdeci">void(* app_callback_t)(uint16_t event, void *param)</div><div class="ttdoc">handler for the dispatched work</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:80</div></div>
<div class="ttc" id="aclass_a2_d_p_default_volume_control_html"><div class="ttname"><a href="class_a2_d_p_default_volume_control.html">A2DPDefaultVolumeControl</a></div><div class="ttdoc">Default implementation for handling of the volume of the audio data.</div><div class="ttdef"><b>Definition:</b> A2DPVolumeControl.h:88</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html"><div class="ttname"><a href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a></div><div class="ttdoc">Abstract class for handling of the volume of the audio data.</div><div class="ttdef"><b>Definition:</b> A2DPVolumeControl.h:28</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html">BluetoothA2DPCommon</a></div><div class="ttdoc">Common Bluetooth A2DP functions.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:111</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a04bc52a4279a503203084492fe20c32e"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a04bc52a4279a503203084492fe20c32e">BluetoothA2DPCommon::set_event_stack_size</a></div><div class="ttdeci">void set_event_stack_size(int size)</div><div class="ttdoc">Defines the stack size of the event task (in bytes)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:208</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a0a8a860a325348cdf210637e8d1159e6"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a0a8a860a325348cdf210637e8d1159e6">BluetoothA2DPCommon::set_connected</a></div><div class="ttdeci">virtual void set_connected(bool active)</div><div class="ttdoc">Calls disconnect or reconnect.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:56</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a0bab92d9317837ecaeacbfe26814e28c"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a0bab92d9317837ecaeacbfe26814e28c">BluetoothA2DPCommon::set_volume</a></div><div class="ttdeci">virtual void set_volume(uint8_t volume)</div><div class="ttdoc">Sets the volume (range 0 - 255)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:138</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a0e570c2c2f9db40873286e0571f0d93a"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a0e570c2c2f9db40873286e0571f0d93a">BluetoothA2DPCommon::get_volume</a></div><div class="ttdeci">virtual int get_volume()</div><div class="ttdoc">Determines the actual volume.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:147</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a168bc344644da48b595e284b7800e3f2"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a168bc344644da48b595e284b7800e3f2">BluetoothA2DPCommon::is_connected</a></div><div class="ttdeci">virtual bool is_connected()=0</div><div class="ttdoc">Checks if A2DP is connected.</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a169e9b94cbbfb7311a8722cc6d436e95"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a169e9b94cbbfb7311a8722cc6d436e95">BluetoothA2DPCommon::set_on_audio_state_changed_post</a></div><div class="ttdeci">virtual void set_on_audio_state_changed_post(void(*callBack)(esp_a2d_audio_state_t state, void *), void *obj=nullptr)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:230</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a2b78346084e12feeea035d006e7cf07a"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a2b78346084e12feeea035d006e7cf07a">BluetoothA2DPCommon::to_str</a></div><div class="ttdeci">const char * to_str(esp_a2d_connection_state_t state)</div><div class="ttdoc">converts esp_a2d_connection_state_t to a string</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:251</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a458bca4d65937c5e2de7bfeb0f454d88"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a458bca4d65937c5e2de7bfeb0f454d88">BluetoothA2DPCommon::get_name</a></div><div class="ttdeci">virtual const char * get_name()</div><div class="ttdoc">Provides the actual SSID name.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:228</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a4bbbd1a2c9c85004afaa7c6dbad45322"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a4bbbd1a2c9c85004afaa7c6dbad45322">BluetoothA2DPCommon::~BluetoothA2DPCommon</a></div><div class="ttdeci">virtual ~BluetoothA2DPCommon()=default</div><div class="ttdoc">Destructor.</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a513b32676d8fc248bb481180f832ef97"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a513b32676d8fc248bb481180f832ef97">BluetoothA2DPCommon::get_connection_state</a></div><div class="ttdeci">virtual esp_a2d_connection_state_t get_connection_state()</div><div class="ttdoc">Determine the connection state.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:22</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a537d576b12d1158eb0681a6195b258de"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a537d576b12d1158eb0681a6195b258de">BluetoothA2DPCommon::set_auto_reconnect</a></div><div class="ttdeci">void set_auto_reconnect(bool active)</div><div class="ttdoc">activate / deactivate the automatic reconnection to the last address (per default this is on)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:28</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a5f13ecf541393c21a5a489235bad27fb"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a5f13ecf541393c21a5a489235bad27fb">BluetoothA2DPCommon::set_on_audio_state_changed</a></div><div class="ttdeci">virtual void set_on_audio_state_changed(void(*callBack)(esp_a2d_audio_state_t state, void *), void *obj=nullptr)</div><div class="ttdoc">Set the callback that is called when the audio state is changed.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:223</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a68f9e168839f0faeb72705ccabbb6b7a"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a68f9e168839f0faeb72705ccabbb6b7a">BluetoothA2DPCommon::set_task_priority</a></div><div class="ttdeci">void set_task_priority(UBaseType_t priority)</div><div class="ttdoc">defines the task priority (the default value is configMAX_PRIORITIES - 10)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:192</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a694940fad2a2d498875cfbdf52eea58b"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a694940fad2a2d498875cfbdf52eea58b">BluetoothA2DPCommon::set_task_core</a></div><div class="ttdeci">void set_task_core(BaseType_t core)</div><div class="ttdoc">Defines the core which is used to start the tasks (to process the events and audio queue)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:198</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a74eadbd69b5c7adf1b190c7e41b75b10"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a74eadbd69b5c7adf1b190c7e41b75b10">BluetoothA2DPCommon::get_audio_state</a></div><div class="ttdeci">virtual esp_a2d_audio_state_t get_audio_state()</div><div class="ttdoc">Determine the actual audio state.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:18</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a76e329bf0587ebf41792871acc69188b"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a76e329bf0587ebf41792871acc69188b">BluetoothA2DPCommon::end</a></div><div class="ttdeci">virtual void end(bool releaseMemory=false)</div><div class="ttdoc">Closes the connection and stops A2DP.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:80</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a7757ddbf424aeb909dc952d7c40fc241"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a7757ddbf424aeb909dc952d7c40fc241">BluetoothA2DPCommon::set_volume_control</a></div><div class="ttdeci">virtual void set_volume_control(A2DPVolumeControl *ptr)</div><div class="ttdoc">you can define a custom VolumeControl implementation</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:152</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a788d81fe538021f912d737de72ed6be6"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a788d81fe538021f912d737de72ed6be6">BluetoothA2DPCommon::connect_to</a></div><div class="ttdeci">virtual bool connect_to(esp_bd_addr_t peer)</div><div class="ttdoc">Connnects to the indicated address.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:44</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a791432e5c800e75fb11b858071cff651"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a791432e5c800e75fb11b858071cff651">BluetoothA2DPCommon::log_free_heap</a></div><div class="ttdeci">void log_free_heap()</div><div class="ttdoc">Logs the free heap.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:246</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a8b37f48a6b0bca33fb21b2a9ae9dab7c"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a8b37f48a6b0bca33fb21b2a9ae9dab7c">BluetoothA2DPCommon::set_connectable</a></div><div class="ttdeci">virtual void set_connectable(bool connectable)</div><div class="ttdoc">Bluetooth connectable.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:223</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a8e53adc58f665113c9ac6a5521e58814"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a8e53adc58f665113c9ac6a5521e58814">BluetoothA2DPCommon::set_discoverability</a></div><div class="ttdeci">virtual void set_discoverability(esp_bt_discovery_mode_t d)</div><div class="ttdoc">Bluetooth discoverability.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:279</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a8f1619be2457a0a9e359ff4fefe1dbf6"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a8f1619be2457a0a9e359ff4fefe1dbf6">BluetoothA2DPCommon::volume_control</a></div><div class="ttdeci">virtual A2DPVolumeControl * volume_control()</div><div class="ttdoc">provides access to the VolumeControl object</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:281</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_a962cc9aef396b06c7eb6f56462a743ac"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#a962cc9aef396b06c7eb6f56462a743ac">BluetoothA2DPCommon::clean_last_connection</a></div><div class="ttdeci">virtual void clean_last_connection()</div><div class="ttdoc">clean last connection (delete)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:208</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_aa6601d3c57e37f77bfdd03a3ef6231e2"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#aa6601d3c57e37f77bfdd03a3ef6231e2">BluetoothA2DPCommon::debounce</a></div><div class="ttdeci">virtual void debounce(void(*cb)(void), int ms)</div><div class="ttdoc">Prevents that the same method is executed multiple times within the indicated time limit.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:237</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_aa79cff78c075c9273ea2b5c03f052fcd"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#aa79cff78c075c9273ea2b5c03f052fcd">BluetoothA2DPCommon::set_on_connection_state_changed</a></div><div class="ttdeci">virtual void set_on_connection_state_changed(void(*callBack)(esp_a2d_connection_state_t state, void *), void *obj=nullptr)</div><div class="ttdoc">Set the callback that is called when the connection state is changed.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:216</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_ab63e627832d6377be32dd700130bf0d8"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#ab63e627832d6377be32dd700130bf0d8">BluetoothA2DPCommon::disconnect</a></div><div class="ttdeci">virtual void disconnect()</div><div class="ttdoc">Closes the connection.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:66</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_ac795a023f85438355a1b00644f2b040f"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#ac795a023f85438355a1b00644f2b040f">BluetoothA2DPCommon::reconnect</a></div><div class="ttdeci">virtual bool reconnect()</div><div class="ttdoc">Reconnects to the last device.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:33</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_acf924bb9f5e348c85e65879c337a4bde"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#acf924bb9f5e348c85e65879c337a4bde">BluetoothA2DPCommon::get_last_peer_address</a></div><div class="ttdeci">virtual esp_bd_addr_t * get_last_peer_address()</div><div class="ttdoc">Provides the address of the last device.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:213</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_ae5e96c34428c50873a0ca7423a6b5402"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#ae5e96c34428c50873a0ca7423a6b5402">BluetoothA2DPCommon::set_event_queue_size</a></div><div class="ttdeci">void set_event_queue_size(int size)</div><div class="ttdoc">Defines the queue size of the event task.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:203</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_common_html_af1e2f14ddbe9266b61f5e721095c3685"><div class="ttname"><a href="class_bluetooth_a2_d_p_common.html#af1e2f14ddbe9266b61f5e721095c3685">BluetoothA2DPCommon::set_scan_mode_connectable</a></div><div class="ttdeci">virtual void set_scan_mode_connectable(bool connectable)</div><div class="ttdoc">Defines if the bluetooth is connectable.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.cpp:288</div></div>
<div class="ttc" id="astructapp__msg__t_html"><div class="ttname"><a href="structapp__msg__t.html">app_msg_t</a></div><div class="ttdoc">Internal message to be sent for BluetoothA2DPSink and BluetoothA2DPSource.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:83</div></div>
<div class="ttc" id="astructapp__msg__t_html_a178b4f47f5dec620dd55568a112bed5c"><div class="ttname"><a href="structapp__msg__t.html#a178b4f47f5dec620dd55568a112bed5c">app_msg_t::cb</a></div><div class="ttdeci">app_callback_t cb</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:86</div></div>
<div class="ttc" id="astructapp__msg__t_html_a94101fa8211369ac8234e5052922bf1d"><div class="ttname"><a href="structapp__msg__t.html#a94101fa8211369ac8234e5052922bf1d">app_msg_t::event</a></div><div class="ttdeci">uint16_t event</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:85</div></div>
<div class="ttc" id="astructapp__msg__t_html_aa9e22bf7fadbb972d0ea4e8841565d36"><div class="ttname"><a href="structapp__msg__t.html#aa9e22bf7fadbb972d0ea4e8841565d36">app_msg_t::sig</a></div><div class="ttdeci">uint16_t sig</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:84</div></div>
<div class="ttc" id="astructapp__msg__t_html_ad3a963624af293f30fb8125e7b5835b6"><div class="ttname"><a href="structapp__msg__t.html#ad3a963624af293f30fb8125e7b5835b6">app_msg_t::param</a></div><div class="ttdeci">void * param</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:87</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>
